#include<cstdio>
using namespace std;
const int maxn = 15000+5;
const int maxy = 32000+5;
int n;
int sum[maxy+1], ans[maxn];

#define lsb(x) (x&(-x))
void add(int x) {
    while(x<=maxy) {
        sum[x]++;
        x+=lsb(x);
    }
}
int query(int x) {
    int ans = 0;
    while(x>0) {
        ans += sum[x];
        x-=lsb(x);
    }
    return ans;
}

int main() {
    scanf("%d", &n);
    for(int i=0; i<n; ++i) {
        int x; scanf("%d%*d", &x);
        x++;   // But please tell my WHY???
               // Why this line will rescue me from a TLE?
        ans[query(x)]++;
        add(x);
    }
    for(int i=0; i<n; ++i) printf("%d\n", ans[i]);
}
